package cn.lingyangwl.agile.common.datasource.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author shenguangyang
 */
public interface CommonMapper extends BaseMapper<Object> {
    /**
     * 使用information_schema检查表是否存在
     */
    int checkTableExists(@Param("tableName")String tableName);

    Integer deleteAllDataByAppId(@Param("tableName") String tableName, @Param("appId") Long appId);
    Integer deleteAllDataByUserId(@Param("tableName") String tableName, @Param("userId") Long userId);
    Integer deleteAllDataByTenantId(@Param("tableName") String tableName, @Param("tenantId") String tenantId);
    Integer deleteAllDataByMainTenantId(@Param("tableName") String tableName, @Param("mainTenantId") String tenantId);
}
